﻿using PoliticalClassifier.Support;
using System.Collections.Generic;
using System.Collections.ObjectModel;

namespace PoliticalClassifier.Domain
{
    /// <summary>
    /// Class represents the Voter's record in a dataset.
    /// </summary>
    public class VoterRecord : IVoterRecord
    {
        #region Construction
        /// <summary>
        /// Initilize VoterRecording by providing voter's Id.
        /// </summary>
        /// <param name="id">Voter's Id</param>
        public VoterRecord(uint id)
        {
            m_id = id;
        }
        #endregion

        #region Public Properties
        /// <summary>
        /// Get voter's ID.
        /// </summary>
        public uint ID
        {
            get { return m_id; }
        }
        /// <summary>
        /// Get attributes collection associated with the voter.
        /// </summary>
        public ICollection<IVoterAttribute> Attributes
        {
            get
            {
                if (m_collectionAttributes == null)
                    m_collectionAttributes = new Collection<IVoterAttribute>();
                return m_collectionAttributes;
            }
        }
        #endregion

        #region Private Fields
        private uint m_id;
        private ICollection<IVoterAttribute> m_collectionAttributes;
        #endregion
    }
}
